﻿/* 6. Write an expression that checks if given point (x, y) is within a circle K(O, 5). */

using System;

public class IsWithinCircle
{
    public static void Main()
    {
        double Ox, Oy, R;
        double x, y;
        double quadratOfDistanceToO;

        Ox = 0;
        Oy = 0;
        R = 5;
        Console.Write("Ox = ");
        Ox = double.Parse(Console.ReadLine());
        Console.Write("Oy = ");
        Oy = double.Parse(Console.ReadLine());
        Console.Write("R = ");
        R = double.Parse(Console.ReadLine());
        Console.Write("x = ");
        x = double.Parse(Console.ReadLine());
        Console.Write("y = ");
        y = double.Parse(Console.ReadLine());

        quadratOfDistanceToO = (x - Ox) * (x - Ox) + (y - Oy) * (y - Oy);
        Console.Write("The point ({0}, {1}) is ", x, y);
        if (quadratOfDistanceToO < R * R)
            Console.Write("within circle");
        else
            Console.Write("on the edge or out of circle");

        Console.WriteLine(" k(({0}, {1}), {2}).", Ox, Oy, R);
    }
}